home *** CD-ROM | disk | FTP | other *** search
/ CDUTIL 13 / CDUTIL #13 Julio 1995.iso / windows / acadcom / ads / adsdef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-08  |  3.8 KB  |  124 lines

  1. /* 
  2.    ADSDEF.H -  C ADS definitions.
  3.  
  4.    CREATED BY:  Ed Becnel   6 January 1994
  5.  
  6.    Copyright (C) 1994 by Autodesk, Inc.
  7.  
  8.    Permission to use, copy, modify, and distribute this software in 
  9.    object code form for any purpose and without fee is hereby granted, 
  10.    provided that the above copyright notice appears in all copies and 
  11.    that both that copyright notice and the limited warranty and 
  12.    restricted rights notice below appear in all supporting 
  13.    documentation.
  14.  
  15.    AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.  
  16.    AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 
  17.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC.
  18.    DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 
  19.    UNINTERRUPTED OR ERROR FREE.
  20.  
  21.    Use, duplication, or disclosure by the U.S. Government is subject to 
  22.    restrictions set forth in FAR 52.227-19 (Commercial Computer 
  23.    Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 
  24.    (Rights in Technical Data and Computer Software), as applicable.
  25.     
  26.    .
  27. */
  28.  
  29. #ifndef _adsdef_h
  30. #define _adsdef_h 1
  31.  
  32.  
  33. #ifdef _MSC_VER
  34. #ifndef RADPACK
  35. #define RADPACK    1
  36. #endif
  37. #endif
  38.  
  39.  
  40. #ifdef RADPACK
  41. #pragma pack(1)
  42. #endif
  43.  
  44. /* useful definitions */
  45. #define TRUE    1
  46. #define FALSE   0
  47. #define EOS     '\0'
  48.  
  49. /* A real to AutoCAD is a double precision float, and must be
  50.    used for all floating point numbers in AutoCAD. */
  51. typedef double ads_real;
  52.  
  53. /* The following types are used in functions that accept points or entity/ss
  54.    names, and return one of these as well. */
  55.  
  56. typedef ads_real ads_point[3];
  57. typedef long ads_name[2];
  58.  
  59. /* The following type is used by functions that accept a 3D matrix */
  60.  
  61. typedef ads_real ads_matrix[4][4];
  62.  
  63. /* The coordinates of a point */
  64. #define X  0
  65. #define Y  1
  66. #define Z  2
  67.  
  68. /* The translation vector of a 3D matrix */
  69. #define T  3
  70.  
  71. /* The PAUSE token for ads_command and ads_cmd */
  72. #define PAUSE "\\"
  73.  
  74. /* The ADS_INITGET control bits */
  75.  
  76. #define RSG_NONULL 0x01               /* Disallow null input */
  77. #define RSG_NOZERO 0x02               /* Disallow zero input */
  78. #define RSG_NONEG  0x04               /* Disallow negative input */
  79. #define RSG_NOLIM  0x08               /* Do not check limits */
  80. #define RSG_GETZ   0x10               /* Get Z coordinate */
  81. #define RSG_DASH   0x20               /* Draw dashed rubber band/box (not a
  82.                                          GEDIT control bit) */
  83. #define RSG_2D     0x40               /* Restrict (getdist) to 2D (causes the
  84.                                          UD_GETZ control bit to be cleared) */
  85. #define RSG_OTHER  0x80               /* Return input string if unknown */
  86.  
  87. /* Binary data stream structure */
  88.  
  89. struct ads_binary {                   /* Binary data chunk structure */
  90.     short clen;                       /* length of chunk in bytes */
  91.     char *buf;                        /* binary data */
  92. };
  93.  
  94. /*  Union for storing different ADS data types. */
  95.  
  96. union ads_u_val {
  97.    ads_real rreal;
  98.    ads_real rpoint[3];
  99.    short rint;
  100.    char *rstring;
  101.    long rlname[2];
  102.    long rlong;   
  103.    struct ads_binary rbinary;
  104. /* TEMPORARY probably, for internal use only at the moment */
  105.    unsigned char ihandle[8];
  106. }; 
  107.  
  108. /* The following is the structure definition of the general result buffer.
  109.    This is used for both passing back results from functions, as well
  110.    as exotic applications like entity lists, and command function lists.
  111.    It is as close as we come to the AutoLISP node structure.  */
  112.  
  113. struct resbuf {                                                  
  114.         struct resbuf *rbnext;        /* Allows them to be "linked" */
  115.         short restype;
  116.         union ads_u_val resval;
  117. };
  118.  
  119. #ifdef RADPACK
  120. #pragma pack( )
  121. #endif
  122.  
  123. #endif    /* !_adsdef_h */
  124.